
(function(){

var rules = {
  "WhiteSpace" : function(r) { with(r) {
    return node(rep(alt(
      lit(' '),
      lit('\n')
    ), 1, -1), {"nodeType" : "WhiteSpace"});
  }},
  "Identifier" : function(r) { with(r) {
    return node(rep(alt(
      lit('a'),
      lit('b')
    ), 1, -1), {"nodeType" : "Identifier"});
  }}
};

for (var i in rules) {
  JavaScript.addRule(i, rules[i](JavaScript.combinators));
}

var combinators = {
  "ws" : function(r) { with(r) {
    return function() { return call("WhiteSpace") };
  }},
  "ows" : function(r) { with(r) {
    return function() { return either(call("WhiteSpace"),empty()) };
  }}
};

for (var i in combinators) {
  JavaScript.combinators[i] = combinators[i](JavaScript.combinators);
}

})();

